﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace WebApplication2
{
    public partial class Grades : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }


        private void Addsubjects()
        {


            for (int i = 0; i < 15; i++)
            {
                TableRow row1 = new TableRow();
                TableCell cell1 = new TableCell();
                Button b = new Button();
                
                b.Width = 90;
                b.Height = 20;
                b.Text = "Subject " + i;
                b.CssClass = "GradeSubjectButtons";
                cell1.Width = 90;
                cell1.Controls.Add(b);

                cell1.CssClass = "GradeSubjectTr";

             
                row1.Cells.Add(cell1);
                Table1.Rows.Add(row1);  
        
            }

        

     

        }

        private void AddGradeMark()
        {
            TableRow row0_1 = new TableRow();
            TableCell cell0_1 = new TableCell();
            TableCell cell0_2 = new TableCell();
            TableCell cell0_3 = new TableCell();
            Label label0_1 = new Label();
            Label label0_2 = new Label();
            Label label0_3 = new Label();

            label0_1.Width = 100;
            label0_2.Width = 100;
            label0_1.Height = 30;
            label0_2.Height = 30;
            label0_3.Width = 100;
            label0_3.Height = 30;

            label0_1.Text = "TYPE";
            label0_2.Text = "RESULT";
            label0_3.Text = "OUT OF";

            label0_1.CssClass = "GradeSubjectLabels";
            label0_2.CssClass = "GradeSubjectLabels";
            label0_3.CssClass = "GradeSubjectLabels"; 

            label0_1.Font.Bold = true;
            label0_2.Font.Bold = true;
            label0_3.Font.Bold = true;


            cell0_1.Controls.Add(label0_1);
            cell0_2.Controls.Add(label0_2);
            cell0_3.Controls.Add(label0_3);

            row0_1.Cells.Add(cell0_1);
            row0_1.Cells.Add(cell0_2);
            row0_1.Cells.Add(cell0_3);

            row0_1.CssClass = "GradeTableTr";

            Table2.Rows.Add(row0_1);




            for (int i = 0; i < 10; i++)
            {
                TableRow row1 = new TableRow();
                TableCell cell1 = new TableCell();
                TableCell cell2 = new TableCell();
                TableCell cell3 = new TableCell();
                Label label1 = new Label();
                Label label2 = new Label();
                Label label3 = new Label();

                label1.Width = 100;
                label2.Width = 100;
                label1.Height = 30;
                label2.Height = 30;
                label3.Width = 100;
                label3.Height = 30;



                label1.Text = "type";
                label2.Text = "type Mark";
                label3.Text = "Mark out of";



                label1.CssClass = "GradeSubjectLabels";
                label2.CssClass = "GradeSubjectLabels";
                label3.CssClass = "GradeSubjectLabels";

                cell1.Controls.Add(label1);
                cell2.Controls.Add(label2);
                cell3.Controls.Add(label3);

                row1.Cells.Add(cell1);
                row1.Cells.Add(cell2);
                row1.Cells.Add(cell3);

                row1.CssClass = "GradeTableTr";

                Table2.Rows.Add(row1);
         
            }


     

        }

        private void AddTotalMark()
        {
            
                TableRow row1 = new TableRow();
                TableCell cell1 = new TableCell();
                TableCell cell2 = new TableCell();
                Label label1 = new Label();
                Label label2 = new Label();

                label1.Width = 100;
                label2.Width = 100;
                label1.Height = 30;
                label2.Height = 30;


                label1.Text = "Subject Total";
                label2.Text = "Subject Total Mark";

                label1.CssClass = "GradeSubjectLabels";
                label2.CssClass = "GradeSubjectLabels";

                cell1.Controls.Add(label1);
                cell2.Controls.Add(label2);

                row1.Cells.Add(cell1);
                row1.Cells.Add(cell2);

                row1.CssClass = "GradeTableTr";

                Table3.Rows.Add(row1);

            
        }





        protected void Button1_Click(object sender, EventArgs e)
        {
            Addsubjects();
            AddGradeMark();
            AddTotalMark();
        }

     
    }
}